<%-- 
    Document   : customer-information
    Created on : Aug 15, 2013, 10:26:30 AM
    Author     : Administrator
--%>

<%@page import="com.ipcc.utility.model.IPCC_CUSTOMERModel"%>
<%@page import="com.ipcc.utility.entity.IPCC_CUSTOMER"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Customer information</title>
    </head>
    <body>
        <%
            String ldn = "";
            String ds = "";
            String name = "";
            String lcd = "";
            try {
                String phoneNumber = request.getParameter("phoneNumber").toString();
                String groupName = request.getParameter("groupName").toString();
                IPCC_CUSTOMER ic = IPCC_CUSTOMERModel.getByPhone_number(phoneNumber);
                if (ic != null) {
//                    if (ic.getLast_dialled_number() != null && !ic.getLast_dialled_number().equalsIgnoreCase("")) {
//                        ds = IPCC_CUSTOMERModel.createDialString(groupName, ic.getLast_dialled_number());
//                        ldn = ic.getLast_dialled_number();
//                    }
                    if (ic.getName() != null) name = ic.getName();                    
                    
//                    if (ic.getLast_call_date() != null) lcd = ic.getLast_call_date();                    
                    
                } else ds = IPCC_CUSTOMERModel.createDialString(groupName, "");                
            } catch (Exception e) {
                e.printStackTrace();
            }
        %>
    <name><%=name%></name>
    <ldn><%=ldn%></ldn>
    <lcd><%=lcd%></lcd>
    <ds><%=ds%></ds>
</body>
</html>
